package tech.pdai.springframework.context;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

public class MyImportSelector implements ImportSelector {

    /**
     * 返回值就是要导入到容器的中bean的全类名
     * @param importingClassMetadata
     * @return
     */
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        System.out.println(importingClassMetadata.getClassName());
        System.out.println(importingClassMetadata.getAnnotationTypes());
        System.out.println(importingClassMetadata.getSuperClassName());
        return new String[] {"tech.pdai.springframework.bean.Green", "tech.pdai.springframework.bean.Yellow"};
    }
}
